import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home,
    redirect:'Home'
  },
  {
    path: '/Home',
    name: 'Home',
    component: Home
  },
  {
    path: '/about',
    name: 'About',
    component: () => import( '../views/About.vue')
  },
  {
    path: '/rank',
    name: 'rank',
    component: () => import( '../views/rank.vue')
  },
  {
    path: '/bookshelf',
    name: 'bookshelf',
    component: () => import( '../views/bookshelf.vue')
  },
  {
    path: '/bookDetails',
    name: 'bookDetails',
    component: () => import( '../components/bookDetails.vue')
  },
  {
    path: '/chapter',
    name: 'chapter',
    component: () => import( '../components/chapter.vue')
  },
  {
    path: '/bookDetails/booksItem',
    name: 'booksItem',
    component: () => import( '../components/booksItem.vue')
  },
  {
    path: '/freeBooks',
    name: 'freeBooks',
    component: () => import( '../components/freeBooks.vue')
  },
  {
    path: '/girlBooks',
    name: 'girlBooks',
    component: () => import( '../components/girlBooks.vue')
  },
  {
    path: '/about/classData',
    name: 'classData',
    component: () => import( '../components/classData.vue')
  },
  {
    path: '/rank/rankList',
    name: 'rankList',
    component: () => import( '../components/rankList.vue')
  },
  {
    path: '/search',
    name: 'search',
    component: () => import( '../components/search.vue')
  },
  {
    path: '/searchData',
    name: 'searchData',
    component: () => import( '../components/searchData.vue')
  },
  {
    path: '/login',
    name: 'login',
    component: () => import( '../components/login.vue')
  },
  {
    path: '/userinfo',
    name: 'userinfo',
    component: () => import( '../components/userinfo.vue')
  },
  {
    path: '/congzhi',
    name: 'congzhi',
    component: () => import( '../components/congzhi.vue')
  },
  {
    path: '/grant',
    name: 'grant',
    component: () => import( '../components/grant.vue')
  },
  {
    path: '/comments',
    name: 'comments',
    component: () => import( '../components/comments.vue')
  }
]

const router = new VueRouter({
  routes,
  linkActiveClass:'com',
  mode: 'history',
})

export default router
